package com.hanxiaozhang.base.dao;

import com.hanxiaozhang.base.entity.DictEntity;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 数据字典
 *
 * @author hanxiaozhang
 * @email hanxiaozhang2018@sina.com
 * @date 2021-04-07
 */
@Mapper
public interface DictDao {

	DictEntity get(Long dictId);
	
	List<DictEntity> list(Map<String, Object> map);

	int save(DictEntity dict);
	
	int update(DictEntity dict);
	
	int remove(Long dictId);

	int batchRemove(Long[] dictIds);

	/**
	 * 通过type查询字典
	 *
	 * @param type
	 * @return
	 */
	@Select("select *  from `base_dict` where  `del_flag` = 0 and  `type` = #{type}")
	List<DictEntity> listByType(@Param("type")  String type);

}
